import asyncio
from pyppeteer import launch

width, height = 1366, 768


async def main():
    browser = await launch(headless=False, args=['--disable-infobars', f'--window-size={width},{height}'])
    page = await browser.newPage()
    await page.setViewport({'width': width, 'height': height})
    await page.goto('https://demo.mycodes.net/daima/suopingjiesuo/')
    await page.evaluate('''() =>{ Object.defineProperties(navigator,{ webdriver:{ get: () => false } }) }''')
    await page.hover('.main-c')
    await page.mouse.down()  # 按下鼠标
    await page.mouse.move(615, 250)  # 移动鼠标
    await page.mouse.move(615, 350)  # 移动鼠标
    await page.mouse.move(615, 400)  # 移动鼠标
    await page.mouse.move(700, 400)  # 移动鼠标
    await page.mouse.move(750, 400)  # 移动鼠标
    await page.mouse.move(760, 350)  # 移动鼠标
    await asyncio.sleep(1)
    await page.mouse.up()  # 松开鼠标
    await asyncio.sleep(10)


asyncio.get_event_loop().run_until_complete(main())